﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

using EnvironmentalMonitor.Support.Business.Environmental;
using EnvironmentalMonitor.Support.Business;
using EnvironmentalMonitor.Support.Module;
using EnvironmentalMonitor.Support.Resource;

namespace EnvironmentalMonitor.WebApplication.Environmental.DetectorType
{
    /// <summary>
    /// 下拉框Json数据页面类
    /// </summary>
    public partial class DetectorTypesComboboxJson : EnvironmentalMonitor.WebApplication.Abstract.AbstractListJson
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<EnvironmentalMonitor.Support.Module.Environmental.DetectorType> modules = new List<Support.Module.Environmental.DetectorType>();

            EnvironmentalMonitor.Support.Module.Environmental.DetectorType areaDetectorType = new Support.Module.Environmental.DetectorType();
            EnvironmentalMonitor.Support.Module.Environmental.DetectorType switchDetectorType = new Support.Module.Environmental.DetectorType();
            EnvironmentalMonitor.Support.Module.Environmental.DetectorType doubleAreaDetectorType = new Support.Module.Environmental.DetectorType();

            switchDetectorType.Type = DetectorTypes.Switch;
            areaDetectorType.Type = DetectorTypes.Area;
            doubleAreaDetectorType.Type = DetectorTypes.DoubleArea;

            modules.Add(switchDetectorType);
            modules.Add(areaDetectorType);
            modules.Add(doubleAreaDetectorType);

            string json = JsonConvert.SerializeObject(modules);

            this.Response.Write(json);
            this.Response.Flush();
            this.Response.End();
        }
    }
}